package com.nondo.rdp.finance.model;

import com.nondo.rdp.auth.domain.User;
import com.nondo.rdp.core.common.CommUtil;

/**
 * 用于用户编辑的bean
 */
public class UserEditBeanInner {

    private Long id; // 编号
    private String username;// 登录名
    private String nickName;// 昵称
    private String avatar; // 用户头像
    private String password;//用户密码
    private String password_confirm;//重复用户密码

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getAvatar() {
        return CommUtil.getUserAvatar(avatar);
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword_confirm() {
        return password_confirm;
    }

    public void setPassword_confirm(String password_confirm) {
        this.password_confirm = password_confirm;
    }

    public static UserEditBeanInner covert2Bean(User user) {
        UserEditBeanInner userBean = new UserEditBeanInner();
        userBean.setId(user.getId());
        userBean.setUsername(user.getUsername());
        userBean.setNickName(user.getNickName());
        userBean.setAvatar(user.getAvatar());
        return userBean;
    }
}
